package Utils

import "encoding/binary"

func MinInt32(a, b int32) int32 {
	if a > b{
		return b
	}
	return a
}

func MinInt64(a, b int64) int64 {
	if a > b{
		return b
	}
	return a
}

func MaxInt32(a, b int32) int32 {
	if a > b{
		return a
	}
	return b
}

func MaxInt64(a, b int64) int64 {
	if a > b{
		return a
	}
	return b
}

func Int32ToBytes(i int32) []byte {
	buf := make([]byte, 4)
	binary.LittleEndian.PutUint32(buf, uint32(i))
	return buf
}

func Int64ToBytes(i int64) []byte {
	buf := make([]byte, 8)
	binary.LittleEndian.PutUint64(buf, uint64(i))
	return buf
}